#include <bits/stdc++.h>
using namespace std;

int main() {
    int T, tmp;
    cin >> T;
    vector<vector<int>> test_data(T, vector<int>(3));
    for (int i = 0; i < T; ++i) {
        cin >> tmp;
        test_data[i][0] = tmp;
        cin >> tmp;
        test_data[i][1] = tmp;
        cin >> tmp;
        test_data[i][2] = tmp;
        // for (auto j: test_data[i]) {
        //     cout << j;
        // }
    }

    for (auto data:test_data) {
        if (data[0] <= 2) {
            cout << "1";
        } else {
            int cur_people = 2;
            int time = 1;
            int cur_small, cur_large;
            int take_small, take_large;
            data[1] = data[1] + 1;
            while (cur_people < data[0]) {
                if (cur_people*2 <= data[2]) {
                    cur_small = 0;
                    cur_large = cur_people;
                    take_small= 0;
                    take_large = cur_people;
                    cur_people += cur_small + 2*cur_large + 2*take_small +3*take_large;

                } else if (cur_people*2 <= (data[1]+data[2])) {
                    cur_large = cur_people;
                    take_large = data[2] - cur_people;
                    take_small = 2*cur_people-data[2];
                    cur_small = 0;
                    cur_people += cur_small + 2*cur_large + 2*take_small +3*take_large;

                } else {
                    // if ()
                    // cur_large = data[2];
                    // cur_small = data[1];
                    cur_people = cur_people - ceil(((float)data[1] + (float)data[2])/2) + 3*data[2] + 3*data[1];
                }
                time += 2;
            }
            cout << time;
        }
    }
}